package com.ruoyi.common.kafka;

import org.apache.kafka.clients.admin.NewTopic;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class KafkaInitialConfiguration {
    @Bean
    public NewTopic initialTopic() {
        // 创建一个名为my-topic的Topic并设置分区数为8，分区副本数为2
        return new NewTopic("my_topic",8, (short) 2 );
    }
}
